package com.aspose.cells;

class zuk {
   zaoe a;
   private zbqg c;
   private int d;
   private String e;
   int b = 0;
   private byte f;
   private static final com.aspose.cells.b.c.a.za g = new com.aspose.cells.b.c.a.za(new String[]{"#DIV/0!", "#N/A", "#NAME?", "#NULL!", "#NUM!", "#REF!", "#VALUE!"});

   zbqg a() {
      return this.c;
   }

   void a(zuk var1) {
      this.d = var1.d;
      this.a.d = var1.a.d;
      this.a.e = var1.a.e;
      if (var1.a.f != null) {
         this.a.f = new byte[var1.a.f.length];
         System.arraycopy(var1.a.f, 0, this.a.f, 0, this.a.f.length);
      }

   }

   zuk(zbqg var1) {
      this.c = var1;
      this.a = new zaoe();
   }

   int b() {
      return this.d;
   }

   void a(int var1) {
      this.d = var1;
   }

   int c() {
      return this.d;
   }

   void b(int var1) {
      this.d = var1;
   }

   int d() {
      short var1 = (short)(this.d & '\uffff');
      return this.d & '\uffff';
   }

   void c(int var1) {
      this.d = var1;
   }

   String e() {
      return this.a.e;
   }

   void a(String var1) {
      this.a.e = var1;
   }

   byte[] f() {
      return this.a.f;
   }

   void a(byte[] var1) {
      this.e = null;
      this.a.f = var1;
   }

   String a(WorksheetCollection var1) {
      if (this.e == null && this.a.f != null) {
         this.e = var1.b().a(this);
      }

      return this.e;
   }

   void a(WorksheetCollection var1, String var2) {
      this.e = var2;
      if (var2.length() != 0) {
         if (var2.charAt(0) == '=') {
            var2 = var2.substring(1).trim();
         }

         byte[] var3 = new byte[]{28, 23};
         switch(g.a(var2)) {
         default:
            int var4 = var2.lastIndexOf(33);
            if (var4 == -1) {
               this.e = null;
            } else {
               String var5 = var2.substring(var4 + 1);
               if (!"#REF!".equals(var5.toUpperCase())) {
                  String var8 = var2.substring(0, 0 + var4);
                  if (var8.charAt(0) == '\'') {
                     var8 = var8.substring(1, 1 + (var8.length() - 2));
                  }

                  if (var8.charAt(0) == '[') {
                     var4 = var8.lastIndexOf(93);
                     var8 = var8.substring(var4 + 1);
                  }

                  var4 = var8.indexOf(58);
                  int var6;
                  int var7;
                  if (var4 == -1) {
                     var6 = var7 = this.c.b(var8);
                  } else {
                     var6 = this.c.b(var8.substring(0, 0 + var4));
                     var7 = this.c.b(var8.substring(var4 + 1));
                  }

                  var4 = var5.indexOf(58);
                  byte var9;
                  byte var10;
                  boolean var13;
                  boolean var14;
                  int var34;
                  int var35;
                  if (var4 == -1) {
                     var9 = 0;
                     var10 = 0;
                     boolean var11 = false;
                     boolean var12 = false;
                     var13 = false;
                     var14 = false;
                     int[] var15 = new int[]{var9};
                     int[] var16 = new int[]{var10};
                     boolean[] var17 = new boolean[]{var11};
                     boolean[] var18 = new boolean[]{var12};
                     boolean[] var19 = new boolean[]{var13};
                     boolean[] var20 = new boolean[]{var14};
                     boolean var21 = zbwl.a(var5, var15, var16, false, var17, var18, var19, var20);
                     var34 = var15[0];
                     var35 = var16[0];
                     var11 = var17[0];
                     var12 = var18[0];
                     var13 = var19[0];
                     var14 = var20[0];
                     if (var21) {
                        var3 = new byte[9];
                        var3[0] = 58;
                        System.arraycopy(com.aspose.cells.b.a.zc.a(var6), 0, var3, 1, 2);
                        System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, var3, 3, 2);
                        System.arraycopy(com.aspose.cells.b.a.zc.a(var34), 0, var3, 5, 2);
                        var3[7] = (byte)var35;
                        if (!var12) {
                           var3[8] = (byte)(var3[8] | 64);
                        }

                        if (!var11) {
                           var3[8] = (byte)(var3[8] | 128);
                        }
                     }
                  } else {
                     var9 = 0;
                     var10 = 0;
                     byte var36 = 0;
                     byte var38 = 0;
                     var13 = false;
                     var14 = false;
                     boolean var40 = false;
                     boolean var41 = false;
                     boolean var42 = false;
                     boolean var43 = false;
                     boolean var44 = false;
                     boolean var45 = false;
                     int[] var46 = new int[]{var9};
                     int[] var22 = new int[]{var10};
                     boolean[] var23 = new boolean[]{var13};
                     boolean[] var24 = new boolean[]{var14};
                     boolean[] var25 = new boolean[]{var40};
                     boolean[] var26 = new boolean[]{var41};
                     int[] var27 = new int[]{var36};
                     int[] var28 = new int[]{var38};
                     boolean[] var29 = new boolean[]{var42};
                     boolean[] var30 = new boolean[]{var43};
                     boolean[] var31 = new boolean[]{var44};
                     boolean[] var32 = new boolean[]{var45};
                     boolean var33 = zbwl.a(var5.substring(0, 0 + var4), var46, var22, true, var23, var24, var25, var26) && zbwl.a(var5.substring(var4 + 1), var27, var28, true, var29, var30, var31, var32);
                     var34 = var46[0];
                     var35 = var22[0];
                     var13 = var23[0];
                     var14 = var24[0];
                     var40 = var25[0];
                     var41 = var26[0];
                     int var37 = var27[0];
                     int var39 = var28[0];
                     var42 = var29[0];
                     var43 = var30[0];
                     var44 = var31[0];
                     var45 = var32[0];
                     if (var33) {
                        if (var40) {
                           if (var44) {
                              var3 = new byte[13];
                              var3[0] = 59;
                              System.arraycopy(com.aspose.cells.b.a.zc.a(var6), 0, var3, 1, 2);
                              System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, var3, 3, 2);
                              System.arraycopy(com.aspose.cells.b.a.zc.a(var34), 0, var3, 5, 2);
                              System.arraycopy(com.aspose.cells.b.a.zc.a(var37), 0, var3, 7, 2);
                              var3[9] = 0;
                              if (!var13) {
                                 var3[10] = (byte)(var3[10] | 128);
                              }

                              var3[11] = -1;
                              if (!var42) {
                                 var3[12] = (byte)(var3[12] | 128);
                              }
                           }
                        } else if (var41) {
                           if (var45) {
                              var3 = new byte[13];
                              var3[0] = 59;
                              System.arraycopy(com.aspose.cells.b.a.zc.a(var6), 0, var3, 1, 2);
                              System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, var3, 3, 2);
                              System.arraycopy(com.aspose.cells.b.a.zc.a((int)0), 0, var3, 5, 2);
                              System.arraycopy(com.aspose.cells.b.a.zc.a((int)65535), 0, var3, 7, 2);
                              var3[9] = (byte)var35;
                              if (!var14) {
                                 var3[10] = (byte)(var3[10] | 64);
                              }

                              var3[11] = (byte)var39;
                              if (!var43) {
                                 var3[12] = (byte)(var3[12] | 64);
                              }
                           }
                        } else {
                           var3 = new byte[13];
                           var3[0] = 59;
                           System.arraycopy(com.aspose.cells.b.a.zc.a(var6), 0, var3, 1, 2);
                           System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, var3, 3, 2);
                           System.arraycopy(com.aspose.cells.b.a.zc.a(var34), 0, var3, 5, 2);
                           System.arraycopy(com.aspose.cells.b.a.zc.a(var37), 0, var3, 7, 2);
                           var3[9] = (byte)var35;
                           if (!var14) {
                              var3[10] = (byte)(var3[10] | 64);
                           }

                           if (!var13) {
                              var3[10] = (byte)(var3[10] | 128);
                           }

                           var3[11] = (byte)var39;
                           if (!var43) {
                              var3[12] = (byte)(var3[12] | 64);
                           }

                           if (!var42) {
                              var3[12] = (byte)(var3[12] | 128);
                           }
                        }
                     }
                  }
               }
            }
         case 0:
         case 1:
         case 2:
         case 3:
         case 4:
         case 5:
         case 6:
            if (var3 != null) {
               if (var1.n().k()) {
                  this.a.f = new byte[var3.length + 4];
                  System.arraycopy(com.aspose.cells.b.a.zc.a(var3.length), 0, this.a.f, 0, 4);
                  System.arraycopy(var3, 0, this.a.f, 4, var3.length);
               } else {
                  this.a.f = new byte[var3.length + 2];
                  System.arraycopy(com.aspose.cells.b.a.zc.a(var3.length), 0, this.a.f, 0, 2);
                  System.arraycopy(var3, 0, this.a.f, 2, var3.length);
               }
            }

         }
      }
   }

   boolean a(boolean var1, int[] var2, int[] var3, int[] var4, int[] var5, int[] var6, int[] var7) {
      if (this.a.a()) {
         return false;
      } else {
         byte var8;
         if (var1) {
            var8 = 4;
            switch(this.a.f[var8]) {
            case 58:
            case 90:
            case 122:
               if (this.a.f.length == 13) {
                  var2[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 1) & '\uffff';
                  var3[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 3) & '\uffff';
                  var4[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 5) & '\uffff';
                  var6[0] = this.a.f[var8 + 7] & 255;
                  var5[0] = var4[0];
                  var7[0] = var6[0];
                  return true;
               }
               break;
            case 59:
            case 91:
            case 123:
               if (this.a.f.length == 17) {
                  var2[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 1) & '\uffff';
                  var3[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 3) & '\uffff';
                  var4[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 5) & '\uffff';
                  var5[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 7) & '\uffff';
                  var6[0] = this.a.f[var8 + 9] & 255;
                  var7[0] = this.a.f[var8 + 11] & 255;
                  return true;
               }
            }
         } else {
            var8 = 2;
            switch(this.a.f[var8]) {
            case 58:
            case 90:
            case 122:
               if (this.a.f.length == 11) {
                  var2[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 1) & '\uffff';
                  var3[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 3) & '\uffff';
                  var4[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 5) & '\uffff';
                  var6[0] = this.a.f[var8 + 7] & 255;
                  var5[0] = var4[0];
                  var7[0] = var6[0];
                  return true;
               }
               break;
            case 59:
            case 91:
            case 123:
               if (this.a.f.length == 15) {
                  var2[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 1) & '\uffff';
                  var3[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 3) & '\uffff';
                  var4[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 5) & '\uffff';
                  var5[0] = com.aspose.cells.b.a.zc.e(this.a.f, var8 + 7) & '\uffff';
                  var6[0] = this.a.f[var8 + 9] & 255;
                  var7[0] = this.a.f[var8 + 11] & 255;
                  return true;
               }
            }
         }

         return false;
      }
   }

   int g() {
      return this.a.d;
   }

   void d(int var1) {
      this.a.d = var1;
   }

   byte[] h() {
      return this.a.f;
   }

   void b(byte[] var1) {
      this.a.f = var1;
   }

   boolean i() {
      return (this.a.d & '\uffff' & 1) != 0;
   }

   boolean j() {
      return (this.a.d & '\uffff' & 8) != 0;
   }

   void a(boolean var1) {
      if (var1) {
         this.a.d |= 65528;
      } else {
         this.a.d &= 65527;
      }

   }

   boolean k() {
      return (this.f & 255 & 1) != 0;
   }

   void b(boolean var1) {
      if (var1) {
         this.f = (byte)(this.f | 1);
      } else {
         this.f = (byte)(this.f & 254);
      }

   }

   boolean l() {
      return (this.f & 255 & 8) != 0;
   }

   void c(boolean var1) {
      if (var1) {
         this.f = (byte)(this.f | 8);
      } else {
         this.f = (byte)(this.f & 247);
      }

   }

   void a(String var1, boolean var2) {
      this.a.e = var1;
      if (var2) {
         this.a.f = new byte[]{2, 0, 0, 0, 28, 23};
      } else {
         this.a.f = new byte[]{2, 0, 28, 23};
      }

   }
}
